package com.mq.producer;
import com.mq.domain.Person;
public class Main {
 
    public static void main(String[] args) {
         
        //In the ActiveMQ manager you can see that there can be as many queues as you want
        String queueName = "person.queue";
         
        Producer producer;       
       
        while(true){
  
            //Let's not create a billion messages per second :)
            try {
                Thread.sleep(5000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
             
            producer = new Producer();       
            
            //Create a Person object that will be sent the Consumer */
            Person p1 = new Person();
            p1.setId(1);
            p1.setName("Name name");
            p1.setAddress("adresa");
 
            producer.produceMessage(queueName, p1);
             
        }
 
    }
 
}